3 * Template Lite config_load template internal module
9 $this->_config_module_loaded
= true;
10 $this->template_dir
= $this->_get_dir($this->template_dir
);
11 $this->config_dir
= $this->_get_dir($this->config_dir
);
12 $this->compile_dir
= $this->_get_dir($this->compile_dir
);
13 $name = ($this->encode_file_name
) ?
md5($this->template_dir
. $file . $section_name . $var_name).'.php' : str_replace(".", "_", str_replace("/", "_", $file."_".$section_name."_".$var_name)).'.php';
17 $debug_start_time = array_sum(explode(' ', microtime()));
22 array_push($this->_cache_info
['config'], $file);
25 if (!$this->force_compile
&& file_exists($this->compile_dir
.'c_'.$name) && (filemtime($this->compile_dir
.'c_'.$name) > filemtime($this->config_dir
.$file)))
27 include($this->compile_dir
.'c_'.$name);
31 if (!is_object($this->_config_obj
))
33 require_once(TEMPLATE_LITE_DIR
. "class.config.php");
34 $this->_config_obj
= new $this->config_class
;
35 $this->_config_obj
->overwrite
= $this->config_overwrite
;
36 $this->_config_obj
->booleanize
= $this->config_booleanize
;
37 $this->_config_obj
->fix_new_lines
= $this->config_fix_new_lines
;
38 $this->_config_obj
->read_hidden
= $this->config_read_hidden
;
41 if (!($_result = $this->_config_obj
->config_load($this->config_dir
.$file, $section_name, $var_name)))
46 if (!empty($var_name) ||
!empty($section_name))
48 $output = "\$this->_confs = " . var_export($_result, true) . ";";
52 // must shift of the bottom level of the array to get rid of the section labels
54 foreach($_result as $value)
56 $_temp = array_merge($_temp, $value);
58 $output = "\$this->_confs = " . var_export($_temp, true) . ";";
61 $f = fopen($this->compile_dir
.'c_'.$name, "w");
62 fwrite($f, '<?php ' . $output . ' ?>');
68 $this->_templatelite_debug_info
[] = array('type' => 'config',
69 'filename' => $file.' ['.$section_name.'] '.$var_name,
71 'exec_time' => array_sum(explode(' ', microtime())) - $debug_start_time );